Add ChaCha20-Poly1305 crypto cipher support and introduce runtime availability checks for crypto ciphers#375
Open
ManManson wants to merge 9 commits intoValveSoftware:masterfrom
Conversation
Some backends may not support AES-GCM on all systems (example: libsodium). Add a new static AES_GCM_CipherContext::IsAvailable() function. Co-Authored-By: past-due <30942300+past-due@users.noreply.github.com> Signed-off-by: Pavel Solodovnikov <pavel.al.solodovnikov@gmail.com>
Some backends may not support AES-GCM on all systems. Be more precise in what algorithms are advertised / initialized. Co-Authored-By: past-due <30942300+past-due@users.noreply.github.com> Signed-off-by: Pavel Solodovnikov <pavel.al.solodovnikov@gmail.com>
This change contains an implementation of the ChaCha20-Poly1305 crypto cipher for all supported crypto libraries (both OpenSSL and Libsodium). Windows's BCrypt library doesn't support it (hence, `ChaCha20_Poly1305_CipherContext::IsAvailable() == false`). In Libsodium, ChaCha20-Poly1305 is always available, while in OpenSSL it depends on whether the library has been compiled with the corresponding features or not (controlled via `OPENSSL_NO_CHACHA` and `OPENSSL_NO_POLY1305` feature macros). Signed-off-by: Pavel Solodovnikov <pavel.al.solodovnikov@gmail.com>
…ing connections Signed-off-by: Pavel Solodovnikov <pavel.al.solodovnikov@gmail.com>
…um impl Signed-off-by: Pavel Solodovnikov <pavel.al.solodovnikov@gmail.com>
Now that there's ChaCha20-Poly1305 implementation alongside AES-GCM (which is always available in libsodium), this restriction is not needed anymore. Signed-off-by: Pavel Solodovnikov <pavel.al.solodovnikov@gmail.com>
…dn't send a list of ciphers
…_fix crypto: Do not add ChaCha20-Poly1305 cipher for legacy client that didn't send a list of ciphers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changeset implements the following three major things:
IsAvailable()method for the correspondingCipherContextclasses).This PR is based on the prior work from @past-due, that was done in the scope of #197
Fixes: #196